package dolf.objects;
import java.awt.Graphics2D;

import dolf.objects.Point;
import dolf.objects.Vector;

public class WorldObject implements java.io.Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	protected boolean visible;
	protected boolean flat;
	protected boolean movable;
	protected boolean collitabe;
	protected Point position;		//this point is the starting point of the line
	protected Vector direc;
	
	public WorldObject(boolean _movable){
		visible = true;
		this.setMovable(_movable);
		this.flat = false;
		this.collitabe = true;
	}
	public WorldObject(boolean _movable, boolean _flat){
		visible = true;
		this.setMovable(_movable);
		this.flat = _flat;
		this.collitabe = true;
	}
	public WorldObject(boolean _movable, boolean _flat, boolean _collitabe){
		visible = true;
		this.setMovable(_movable);
		this.flat = _flat;
		this.collitabe = _collitabe;
	}
	public void paint(Graphics2D g){}
	
	public boolean isVisible(){
		return this.visible;
	}
	
	public javax.swing.ImageIcon getIcon(){
		return null;
	}
	public String getName() {
		return null;
	}
	public boolean isMoving(){
		if(!this.isMovable()){
			return false;
		}
		if(this.getMotion().getX()==0 && this.getMotion().getY()==0){
			return false;
		} else {
			return true;
		}
	}
	
	public boolean isMovable(){
		return this.movable;
	}
	public void setMovable(boolean mv){
		this.movable = mv;
	}
	public void setMotion(Vector mv){
		this.direc = mv;
	}
	public void setVisible(boolean vis){
		this.visible = vis;
	}
	public Point getPosition(){
		return this.position;
	}
	public void  setPosition(Point position){
		this.position = position;
	}
	public boolean isCollitabe(){
		return this.collitabe;
	}
	public void setCollitabe(boolean _collitabe){
		this.collitabe = _collitabe;
	}
	public void setFlat(boolean fl){
		this.flat = fl;
	}
	public boolean isFlat(){
		return this.flat;
	}
	/*public boolean collition(WorldObject obj){
		return false;
	}*/
	public Vector getMotion(){
		return this.direc;
	}
	public boolean newMotion(WorldObject object){
		System.out.println("WorldObject newMO");
		return true;
	}

	//public void move(Point force){}
}
